Method and device for determining rhythm units in a musical piece

ABSTRACT

A method for determining rhythm units (beats per minute or BPM) in (digital) audio data forming a musical piece. The audio data is split among a plurality of determination paths wherein it is subdivided into predetermined frequency bands. The data is analyzed for transients in order to determine attack events. In addition, the time intervals between two successive attack events are measured. In this case, the time intervals are averaged and defined as the frequency-band-specific rhythm unit (BPM) of the audio data in the respective determination path. Thus, the rhythm unit which exhibits the highest beat number (BPM number) is selected from the frequency-band-specific rhythm units (BPM) of the determination paths.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a device for determining rhythmunits in a musical piece, and it also relates to a method and a devicefor determining rhythm units in musical pieces on the basis of digitalaudio data.

[0003] Devices for determining rhythm units in a musical piece actuallydetermine the beats per minute in a musical piece or the tempo of themusical piece, and are also known as BPM detectors (where BPM stands forbeats per minute). Such devices are used in the most diverse sectors ofthe music business. Disk jockeys may wish to measure the tempo of twodifferent music sources to be able to coordinate their tempos. In MIDIapplications, the BPM detector is used to synchronize the speed of aMIDI event sequencer with an existing audio track. In a music databasesystem, it is possible, for example, to characterize music by rhythmunits and to assign it indices based on its BPM value.

[0004] Thus, real-time implementations of devices for determining rhythmunits have usually been based on the principles of autocorrelation andon the principles of a variable threshold.

[0005] Unfortunately, these two principles cannot determine beatsgreater than 5 to 6 rhythm units (BPM).

[0006] One object of the present invention is to provide a method fordetermining rhythm units in digital audio data and a device forperforming the method, to ensure faster determination than in the past,together with high determination accuracy.

SUMMARY OF THE INVENTION

[0007] The invention relates to a method and a device that permits adetermination accuracy of up to ±0.1 rhythm units (BPM) after ameasurement time of just three periods and a speed of 3 rhythm units(BPM). When the inventive method and the inventive device are used fordisk jockey applications, the range of rhythm periods to be measuredpreferably corresponds to 60 to 160 rhythm units (BPM).

[0008] More specifically, the invention relates to a device having aplurality of parallel processing blocks or determination paths, throughall of which the digital or digitized audio signal passes. At the outputof the parallel determination paths, a logic circuit selects thatdetermined value of rhythm units which represents the most plausiblemeasurement, and this determination result is preferably indicatedoptically on a suitable display.

[0009] More specifically, each determination path monitors a very narrowfrequency band, which is obtained from the total frequency band of theaudio data by bandpass filters. A transient detector is connecteddownstream from the respective bandpass filter and is used to check theattack events for transients. The time interval occurring between twosuccessive attack events (transients) is measured and analyzed by aperiodicity detector, whereupon an averaged resultant BPM value isdisplayed.

[0010] More specifically, the invention provides, a method fordetermining rhythm units (BPM) in (digital) audio data. This audio datais split among a plurality of determination paths,

[0011] a) wherein this data is subdivided into predetermined frequencybands,

[0012] b) wherein the data is analyzed for transients to determineattack events,

[0013] c) wherein the time intervals between two successive attackevents are measured,

[0014] d) wherein the time intervals are averaged and defined as thefrequency-band-specific rhythm unit (BPM) of the audio data in therespective determination path, and wherein that rhythm unit whichexhibits the highest beat number (BPM number) which is selected from thefrequency-band-specific rhythm units (BPM) of the determination paths.

[0015] As already mentioned herein above, the determined rhythm unit(BPM) is preferably indicated optically.

[0016] The frequency bands for step a) are preferably extremely narrowor are selected with high Q.

[0017] Since the center frequency of the instruments that set the rhythmunit in musical pieces lies at a very high and/or a very low end of theaudio frequency spectrum, the frequency bands of the individualdetermination paths are selected accordingly.

[0018] To measure the transients in step b), the maximum average energyof the audio signal in the frequency band of the respectivedetermination path is determined as a function of time t_(w). Thus, theamplitude of the audio signal in a time window of predetermined lengthis squared and averaged for determination of its energy in the frequencyband of the respective determination path. Preferably, the time windowis a rectangular integration window. The squared amplitude of the audiodata is preferably delayed by a delay element, and subtracted from theinput signal of the delay line and summed using a further delay element,to obtain the rectangular integration window that measures the averageenergy in the frequency band as a function of time t_(w). To ensure anoverlapping sequence of successive time windows, the time windows ofsuccessive energy-determination values are preferably scaled with aconstant factor c and output with constant time intervals t_(s)(t_(s)<t_(w)).

[0019] From the determined energy values, a local maximum is preferablycalculated. For this calculation a linear regression is used todetermine the maximum average energy of the audio data. As the localmaximum, there is calculated an energy value which is larger than adefined number of preceding energy values and a defined number ofsubsequent energy values. In addition, for the local maximum, the energyvalue in question must be larger than a minimum energy level or aseparately determined threshold value.

[0020] Since the rhythm unit determined in the individual determinationpaths as explained herein above can also be, one quarter or one half ordouble the sought rhythm unit, the determined rhythm unit is restored toa basic rhythm unit by scaling as disclosed in step d), hereinabove.Thus, no multiple of the basic rhythm unit is output as the rhythm-unitdetermination result.

[0021] The present invention provides a device for determining therhythm unit (BPM) in digital audio data by performing the inventivemethod, the device has an input to which the audio data is applied andwith an output at which the determined rhythm unit is output. Thedetermination device has a plurality of rhythm-unit detectors (BPMdetectors), which are connected in parallel between the input and alogic circuit upstream from the output. The rhythm-unit detectorscomprises a plurality of components:

[0022] These components can include a bandpass filter for separating afrequency range from the audio signal present at the input. The bandpassfilters of the rhythm-unit detectors cover at least part of the totalbandwidth of the audio signal. There is also a transient detector fordetermining attack events and a timer for measuring the time intervalsbetween two successive attack events. There is also a periodicitydetector for averaging the time intervals and defining the averaged timeintervals as a frequency-band-specific rhythm unit (BPM) of the audiodata in the respective determination path. In this case, the logiccircuit is designed to select from the frequency-band-specific rhythmunits (BPM) of the determination paths that which has the highest beatnumber (BPM number).

[0023] For optical indication of the determined rhythm unit (BPM), adisplay device is preferably connected downstream from the logiccircuit.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Other objects and features of the present invention will becomeapparent from the following detailed description considered inconnection with the accompanying drawings which disclose at least oneembodiment of the present invention. It should be understood, however,that the drawings are designed for the purpose of illustration only andnot as a definition of the limits of the invention.

[0025] In the drawings, wherein similar reference characters denotesimilar elements throughout the several views:

[0026]FIG. 1 is a schematic block diagram of the inventive device;

[0027]FIG. 2 is a schematic block diagram of a window integrator of thetransient detector of one of the rhythm-unit detectors in the deviceshown in FIG. 1;

[0028]FIG. 3 is a schematic block diagram of a threshold circuit of thetransient detector for the transient detector of one of the rhythm-unitdetectors in the device shown in FIG. 1;

[0029]FIG. 4 is a schematic block diagram of a detector for determininga local maximum of the transient detector of one of the rhythm-unitdetectors of the device of FIG. 1;

[0030]FIG. 5 shows a diagram of a linear regression applied in thetransient detector of one of the rhythm-unit detectors of the device ofFIG. 1;

[0031]FIG. 6 shows a periodicity detector of one of the rhythm-unitdetectors of the device of FIG. 1 in the form of a flow diagram; and

[0032]FIG. 7 shows schematically a flow diagram, showing the function ofthe logic circuit of the device of FIG. 1.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0033]FIG. 1 shows the embodiment of a device for determining rhythmunits (BPM) in a musical piece. The device has an input 10 and an output11. There is also an analog/digital converter coupled to an audio inputimmediately downstream for reading (A/D) analog signals and convertingthem to digital signals. The digital audio data present at the output ofthe analog-to-digital converter is injected into a plurality ofrhythm-unit detectors connected in parallel, namely into rhythm unitdetectors 13, 14, . . . n. The output signals of rhythm-unit detectors13, 14, . . . n, are injected into a corresponding number of inputs of alogic circuit 15 or display logic, whose output is connected to output11 of the device.

[0034] The construction of rhythm-unit detectors 13, 14, . . . n will beexplained hereinafter, using as an example the construction of detector13, which is chosen as representative of the other detectors, whichbasically have the same construction.

[0035] A bandpass filter 16 is disposed at the input of detector 13.This bandpass filter has a very narrow bandwidth or a very high Q. Thecenter frequencies of the bandpass filters of the various rhythm-unitdetectors 13, 14, . . . n are chosen so that they are different from oneanother and, in particular, cover a known band region of the digitalaudio data. The center frequencies of the respective bandpass filtersare preferably located in the very high and very low frequency range ofthe audio spectrum, to monitor typical rhythm instruments, such as bassdrums and Hi-Hats.

[0036] The output signal of bandpass filter 16 is injected into atransient detector 17, which is used to analyze attack events fortransients, and determine rhythm units from the filtered digital audiodata. This transient detector contains a window integrator 18, which isshown schematically in FIG. 2, a threshold circuit 19, which is shown inFIG. 3, a detector for determining a local energy maximum, which isshown schematically in FIG. 4 and is denoted as a whole by referencesymbol 20, and a linear regression means, whose function is shown in theform of a diagram in FIG. 5. The transient detector also cooperates witha timer 21.

[0037] Transient detector 17 will now be explained in more detail forreconstruction of its components in connection with timer 21.

[0038] To determine transients of the bandpass-filtered audio signal (ofthe digital audio data, hereinafter also referred to as the audiosignal), the audio signal is squared and averaged over time via a timewindow of length t_(w). To minimize computing load, a time window isselected in the form of a rectangular analysis window or integrationwindow. This permits the use of a very simple window-generation method,shown in greater detail in FIG. 2.

[0039]FIG. 2 shows that the squared audio signal is injected into adelay line 22. On the output side of delay line 22, there are connecteda NOT element 23 and a summing element 24, to the input side wherein theinput signal is also applied in delay line 22. As a result, the outputsignal of the delay line is subtracted from the input signal of thedelay line, and this subtraction result is summed using a further delayelement, which is not shown in greater detail. The result is arectangular integration window, which measures the average energy of theaudio signal in the frequency band as a function of time t_(w). Acorresponding timing diagram is shown in the bottom left portion of FIG.2.

[0040] The measured energy values are scaled with a constant factor “c”in a scaler 25 and are output with constant time intervals t_(s), whichare generated using a clock generator 26, which actuates a switch 27 andwhose output signal is also connected to a counter 28. To ensureoverlapping of windows, t_(s) should be made shorter than t_(w) (forexample, t_(s)=0.5×t_(w)).

[0041] The clock generator also progressively increments time counter 28by t_(s), to apply, as explained hereinafter, a signal to local maximumdetector 20 connected downstream.

[0042] The signal input into scaler 25 is also injected into thresholdcircuit 19, which is shown schematically in FIG. 3 and which will now beexplained in more detail.

[0043] To monitor the average energy level of the frequency band, apeak-value-holding circuit is used. This peak-value circuit, which isshown in FIG. 2, has a construction known in itself. Threshold circuit19, which is designed as the peak-value-holding circuit, ensures thatthe output signal of the circuit is delayed by 5×t_(s) in open delayline 29 and, in a scaling circuit 30, is scaled by the constant factor“c”, for which a value smaller than 1.0 is chosen.

[0044]FIG. 4 shows the local maximum detector 20. The output signal ofwindow integrator 18 is applied to the input of local maximum detector20. In particular, the output signal of the window integrator isinjected into a delay line 31, which comprises a total of ten nestedindividual delay elements, each denoted by z⁻¹. The output signal of thefifth delay element is denoted by X(n), and it is assumed that itrepresents the local maximum. First, the measured energy X(n) isverified as to whether it is higher than the five preceding energyvalues and lower than the five subsequent energy values (step S100). Inthe next step S 102, X(n) is checked as to whether it exceeds thethreshold generated in threshold circuit 19 of FIG. 3. To avoidmeasurement of the BPM or rhythm unit when no audio signal is present,X(n) is verified as to whether it exceeds a defined minimum energy levelMinLevel.

[0045] Since a linear regression is applied later in subsequent step S104, the two previously measured and the two subsequently measuredenergy values X(n) should satisfy the following two conditions:

X(n−2)<X(n−1)

[0046] and

X(n+1)>X(n+2).

[0047] Assuming in the music signal that some percussion instruments cangenerate, transients with factors of 2 or 4 times the actual BPM value,the minimum time interval is taken as 90 ms in the present example.Thus, all local maxima that occur in a time interval of 90 ms startingfrom the previously determined transient are ignored (step S 103:counter>t_(min)).

[0048] Step S 103 is followed by step S 104, wherein there is a linearregression, an example of which is shown in the form of a diagram inFIG. 5.

[0049] Since the existence of local maxima is sampled only in timeintervals of length t_(s), it is obvious that the location of a localmaximum can be determined only with a precision of ±0.5×t_(s), becausethe time counter is also implemented in steps of t_(s). To achieve moreprecise location of the local maximum, therefore, a four-point linearregression is calculated using the two previously measured and the twosubsequently measured energy values Xn, as shown in FIG. 5.

[0050] As is evident from FIG. 1, transient detector 17 is followed by atimer 21.

[0051] In timer 21, a calculated time value At is added to the value ofthe time counter. The resulting value is relayed to periodicity detector13.

[0052]FIG. 6 shows the function of periodicity detector 21 a in the formof a flow diagram. In step S 200 therein, the measured time intervalt_(p) is first converted to a rhythm-unit or BPM value. Under theassumption that the measured time interval could result from a rhythmunit equal to a multiple of ½, ¼ or 2, the actual BPM value of theanalyzed musical piece is restored to the basic rhythm unit since, inthe present embodiment, the inventive device is used only to determineBPM values in the range of 60 to 160 BPM, and it is therefore assumedthat BPM values below or above this range are possible multiples of theactual BPM value. For this reason, the current value BPM_(new) is scaledwith the factor 2, 4 or 0.5, to restore this factor to the basic factor(step S 201 a, step S 202 a and step S 203 a).

[0053] Thereafter the average value BPM_(avr) of the previously measuredBPM values is calculated by dividing the BPM summing element value “SUM”by the number of summed BPM values (NUMBER) and compared with the newmeasured value BPM_(new). When the difference lies within a limit ofΔBPM_(max), BPM_(new) is added to “SUM” and “NUMBER” is incrementedby 1. If, in addition, “NUMBER” is greater than or equal to 3, an errorflag “FAIL” is canceled and a new BPM_(avr) value is calculated andrelayed to the output of periodicity detector 13. In contrast, if thedifference between BPM_(new) and BPM_(avr) is larger than ΔBPM_(max),the new measurement is regarded as erroneous. If error flag “FAIL” hadalready been set beforehand, “SUM” and “NUMBER” are “reinitialized” with“0”. Otherwise error flag “FAIL” is set.

[0054] The output signal of periodicity detector 21 a is relayed tologic circuit 15, at whose other inputs the output signals of theperiodicity detectors of the further BPM detectors 13, 14, . . . n arepresent. The functional principle of logic circuit 15 is illustrated inFIG. 6 in the form of a flow diagram.

[0055] Accordingly, whenever a new rhythm unit or BPM value is measuredand injected into periodicity detector 21 a, the most plausible measuredBPM value is determined by a rhythm-unit counter. For all n BPMdetectors 13, 14, . . . n, the BPM_(avr) value of that BPM detector withthe higher “NUMBER” value is selected, relayed to the output of logiccircuit 15 and optically indicated on a display device, when at leastthree continuous rhythm units have been determined.

[0056] Accordingly, while at least one embodiment of the presentinvention has been shown and described, it is to be understood that manychanges and modifications may be made thereunto without departing fromthe spirit and scope of the invention as defined in the appended claims.

What is claimed is:
 1. A method for determining rhythm units in digitalaudio data forming a musical piece, wherein the audio data is splitamong a plurality of determination paths, the method comprising thesteps of: a) subdividing the rhythm units into a plurality ofpredetermined frequency bands; b) analyzing the rhythm units for atleast one transient to determine a plurality of attack events; c)measuring a time between two successive attack events; and d) averaginga plurality of time intervals defined as frequency-band-specific rhythmunit (BPM) of the audio data in respective determination paths wherein arhythm unit which exhibits a highest beat per minute number (BPM number)is selected from the frequency-band specific rhythm units (BPM) of thedetermination path.
 2. The method as in claim 1, wherein the determinedrhythm unit is indicated optically.
 3. The method as in claim 1, whereinsaid step of subdividing the rhythm units into a plurality of frequencybands includes subdividing into a plurality of frequency bands that areextremely narrow.
 4. The method as in claim 1, wherein said step ofsubdividing the rhythm units into a plurality of frequency bandsincludes subdividing the rhythm units at a very high or very low end ofthe audio frequency spectrum.
 5. The method as in claim 1, furthercomprising the step of determining a maximum average energy of an audiosignal in the frequency band of the respective determination path whichis determined as a function of time (tw).
 6. The method as in claim 5,wherein said step of determining a maximum average energy of an audiosignal includes squaring and averaging an amplitude of an audio signalto determine its energy in the frequency band of the respectivedetermination path.
 7. The method as in claim 6, wherein said timewindow is a rectangular integration window.
 8. The method as in claim 6,further comprising the step of delaying said squared amplitude of theaudio signal via a delay element, wherein said delay element issubtracted from the input signal of the delay line and summed using afurther delay element.
 9. The method as in claim 8, further comprisingthe step of overlapping successive time windows of successive energydetermination values by sealing with a constant factor c and thenoutputting with constant time intervals ts (ts<tw).
 10. The method as inclaim 6, further comprising the steps of calculating a local maximumfrom said determined energy values; and applying a linear regression fordetermining a maximum average of the audio signal.
 11. The method as inclaim 10, wherein said step of calculating a local maximum includescalculating it as an energy value which is larger than a defined numberof subsequent energy values.
 12. The method as in claim 11, wherein saidstep of calculating a local maximum includes determining whether theenergy value is larger than a minimum energy level or a separatelydetermined threshold value.
 13. The method according to claim 12,further comprising the step of scaling said rhythm unit to ensure thatit does not represent a multiple of a basic rhythm unit.
 14. A devicefor determining the rhythm units in digital audio data including aninput to which audio data is applied, an output, at which a rhythm unitis output and also a plurality of rhythm unit detectors which areconnected in parallel between the input and a logic circuit disposedupstream from the output, the detectors comprising the followingcomponents: a) a bandpass filter for separating a frequency range fromthe audio signal present at the input said bandpass filters covering atleast part of the total bandwidth signal; b) a transient detector incommunication with said bandpass filter said transient detector fordetermining attack events; c) a timer for measuring the time intervalsbetween two successive attack events; and d) a periodicity detector foraveraging the time intervals and defining the averaged time interval asa frequency-band-specific-rhythm unit (BPM) of the audio data in adetermination path of said rhythm unit detectors, wherein the logiccircuit is designed to select from the frequency band specific rhythmunits of the determination paths that rhythm unit (BPM) which has thehighest beat number.
 15. The device as in claim 14, further comprising adisplay device coupled downstream from said logic circuit for indicatingthe determined rhythm unit.